﻿
@{
    //Layout = "~/Views/Shared/_Layout.cshtml";
    Layout = null;
}
@model Yyyg.WebUI.Models.AddrVM
<link href="~/Content/addrform.css?@Tools.GetRandMax()" rel="stylesheet" />
<link href="~/Lib/layui/extension/bioarea/css/common.css" rel="stylesheet" />
<form class="addrform layui-form" id="addrpostform" action="/SpAddr/Add" method="post" lay-filter="example">
    <input type="hidden" id="#addrId" name="Id" value="-1" />
    <div>
        <label class="formtit">地址信息:</label>
        <div class="formcont region" id="bioarea-wrap">
            <div>
                <select lay-verify="required" style="width: 100px;" class="level-1-select" lay-filter="#bioarea-wrap1level" name="ProvinceCode">
                    <option value="">请选择省</option>
                </select>
            </div>
            <div>
                <select lay-verify="required" class="level-2-select" lay-filter="#bioarea-wrap2level" name="CityCode">
                    <option value="">请选择市</option>
                </select>
            </div>
            <div>
                <select lay-verify="required" class="level-3-select" lay-filter="#bioarea-wrap3level" name="CountyCode">
                    <option value="">请选择县</option>
                </select>
            </div>
        </div>
    </div>
    <div>
        <label class="formtit">详细地址:</label>
        <div class="formcont">
            <textarea name="Detarea" required lay-verify="required" id="addr-det"  rows="2" cols="20">@Model.Detarea</textarea>
        </div>
    </div>
    <div>
        <label class="formtit">收货人:</label>
        <div class="formcont">
            <input autocomplete="off" required lay-verify="required" id="addr-conname" class="layui-form-text" type="text" name="ConsigneeName" value="@Model.ConsigneeName" maxlength="15" placeholder="长度不超过15个字符" />
        </div>
    </div>
    <div>
        <label class="formtit">手机号码:</label>
        <div class="formcont">
            <input autocomplete="off" required lay-verify="phone" id="addr-conmob" class="layui-form-text" type="text" name="ConsigneeMobel" value="@Model.ConsigneeMobel" maxlength="11" placeholder="请输入11位手机号" />
        </div>
    </div>
    <div>
        <label class="formtit">默认地址:</label>
        <div class="formcont">
            <input id="addr-isdefault" name="SetDef" checked type="checkbox" lay-text="Yes|No" lay-skin="switch">
        </div>
    </div>
    <div class="btnbox">
        <button id="addr-save" class="layui-btn layui-btn-warm" lay-submit lay-filter="formDemo">保存</button>
    </div>
</form>
<script>
    // 组件路径
    layui.config({
        base: '/Lib/layui/extension/bioarea/js/'
    }).extend({
        bioarea: 'bioarea'
    });
    layui.use(['form', 'bioarea'], function () {
        var form = layui.form
            , bioarea = layui.bioarea

        bioarea.render({
            elem: '#bioarea-wrap',
            defaultData: {
                provinceCode: '',
                cityCode: '',
                countyCode: ''
            },
            form:form
        })
    });
</script>